﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GA.Shared.Objects;

namespace GA.Shared.Exceptions
{
    [Serializable]
    public class AuthenticationException : Exception
    {
        public User User { get; private set; }

        public AuthenticationException()
        {
        }

        public AuthenticationException(User user) :
            base(string.Format("Authentication keys for User {0} (Id {1}) did not match what was on the sever.", user.Name, user.Id))
        {
            User = user;
        }

        public AuthenticationException(string message)
            : base(message)
        {
        }

        public AuthenticationException(string message, User user)
            : base(message)
        {
            User = user;
        }

        public AuthenticationException(string message, Exception ex)
            : base(message, ex)
        {
        }

        public AuthenticationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
            : base(info, context)
        {
        }
    }
}
